/*
 * gTranslate.h
 *
 *  Created on: 16.08.2009
 *      Author: index01d
 */

#ifndef GTRANSLATE_H_
#define GTRANSLATE_H_

#include <QObject>
#include <QtNetwork>

/**
 * gTranslate
 * @desc: googleTranslate class
 */
class gTranslate : public QObject
{
	Q_OBJECT

public:
	gTranslate();
	virtual ~gTranslate();

	QStringList getLangs();

public slots:
	void translateString(const QString& text);
	void setLangs(const QString& from, const QString& to);

signals:
	void tReady(const QString& text);

protected:
	QNetworkAccessManager *mManager;
	QString mFrom;
	QString mTo;
	QStringList mLangs;
protected slots:
	void translateFinished(QNetworkReply *reply);

private:
	void fillLangs();
};

#endif /* GTRANSLATE_H_ */
